from pathlib import Path


def get_class_name(data_dir: str) -> list:
    train_dir = Path(data_dir) / "train"
    return sorted(d.name for d in train_dir.iterdir() if d.is_dir())


names = get_class_name(r"C:\Users\23639\Downloads\cls_chinese_medicine")
print(names)
print(len(names))